

#include <iostream>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <stack>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long lld;


vector<int> Zfunc(string& str) {
	int n = str.size();
	vector<int>z(n);
	int l = 0, r = 0;
	for (int i = 1; i < n; i++) {
		if (i <= r) {
			z[i] = min(r - i + 1, z[i - l]);
		}
		while (i + z[i] < n && str[z[i]] == str[i + z[i]]) {
			z[i]++;
		}
		if (i + z[i] - 1 > r) {
			l = i;
			r = i + z[i] - 1;
		}
	}
	return z;
}

int getCnt(vector<int>& Z, int len) {
	int cnt = 1;
	for (int i = len; i < Z.size();) {
		if (Z[i] >= len) {
			cnt++;
			i += len;
		}
		else i++;
	}
	return cnt;
}

int getFix(vector<int >& Z, string& s, int k) {
	int left = 0, right = s.length() / k;
	while (left < right) {
		int mid = (left + right) / 2 + (left + right) % 2;
		if (getCnt(Z, mid) >= k) {
			left = mid;
		}
		else {
			right = mid - 1;
		}
	}

	return left;
}

void solve() {
	int t;
	cin >> t;
	while (t--) {
		int n, l, r;
		cin >> n >> l >> r;
		string s;
		cin >> s;
		auto Z = Zfunc(s);
		vector<int> ans(s.length() + 1, 0);
		int sl = sqrt(s.length()) + 0.5;
		for (int i = 1; i <= sl; ++i) {
			ans[i] = max(ans[i], getFix(Z, s, i));
			int k = getCnt(Z, i);
			ans[k] = max(ans[k], i);
		}

		for (int i = s.length() - 1; i > 0; --i) {
			ans[i] = max(ans[i + 1], ans[i]);
		}


		for (; l <= r; ++l) {
			cout << ans[l] << " ";
		}
		cout << endl;
	}
}


int main() {
	solve();
	return 0;
}
/*
7
3 3 3
aba
3 3 3
aaa
7 2 2
abacaba
9 4 4
abababcab
10 1 1
codeforces
9 3 3
abafababa
5 3 3
zpozp


2
10 1 1
aaaaaaaaaa
10 1 1
abcdaabcda



7
3 1 3
aba
3 2 3
aaa
7 1 5
abacaba
9 1 6
abababcab
10 1 10
aaaaaaawac
9 1 9
abafababa
7 2 7
vvzvvvv

 */